//中间件 检测是否登录

module.exports = (req,res,next)=>{
  console.log(req.session.user)
    if(!req.session.user){
      return res.redirect('/admin/login');
    };
    next();
  }